package com.njwt.cloud.mscommon.feign.fallback;

import com.njwt.cloud.mscommon.feign.client.AuthorityClient;
import com.njwt.cloud.mscommon.support.ApiResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author <a href="mailto:xingxiaofeng@gtmap.cn">xingxiaofeng</a>
 * @date 2022-06-21
 * @desc AuthorityClientFallBack
 */
@Component
public class AuthorityClientFallBack implements AuthorityClient{
    private final Logger logger = LoggerFactory.getLogger(AuthorityClientFallBack.class);
    @Override
    public ApiResponse getAuthorityByUserId(String id) {
        logger.error("调用user-provider服务getAuthorityByUserId方法失败!");
        return ApiResponse.hystrixError("user-provider", "getAuthorityByUserId");
    }

    @Override
    public ApiResponse getOauthClientDetailsByClientId(String clientId) {
        logger.error("调用user-provider服务getOauthClientDetailsByClientId方法获取认证客户端详情信息失败!");
        return ApiResponse.hystrixError("user-provider", "getOauthClientDetailsByClientId");
    }
}
